﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using Kotonoha.Server.Plugins;

namespace Kotonoha.Server.UI.Converters {
    public class PluginStatusConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {

            // Check for design mode. 
            if ((bool)(DesignerProperties.IsInDesignModeProperty.GetMetadata(typeof(DependencyObject)).DefaultValue)) {
                return false;
            }


            Plugin p = value as Plugin;
            if (p == null) {
                return "";
            }
            return p.GetMessage();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
            throw new System.NotImplementedException();
        }
    }
}